package com.fc.h5dispaly.h5display.viewpager;

/**
 * Created by lenovo on 2020/5/11
 * Describe:
 */

import android.content.Context;
import android.view.animation.Interpolator;
import android.widget.Scroller;

public class CustomSpeedScroller extends Scroller {
    private int mDuration = 1000;

    public CustomSpeedScroller(Context context) {
        super(context);
    }

    public CustomSpeedScroller(Context context, Interpolator interpolator) {
        super(context, interpolator);
    }

    @Override
    public void startScroll(int startX, int startY, int dx, int dy, int duration) {
        // Ignore received duration, use fixed one instead
        super.startScroll(startX, startY, dx, dy, mDuration);
    }

    @Override
    public void startScroll(int startX, int startY, int dx, int dy) {
        // Ignore received duration, use fixed one instead
        super.startScroll(startX, startY, dx, dy, mDuration);
    }

    /**
     * 设置切换时间
     */
    public void setDuration(int time) {
        mDuration = time;
    }

}
